<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录</title>
		<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
	</head>
	<body>
		<form id="form_login">
			账号<input type="text" name="username" id="" value="" />
			密码<input type="text" name="password" id="" value="" />
		</form>
		<button onclick="doLogin()" type="button">登录</button>
		<script>
		function doLogin(){
			$.ajax({
				url:"http://localhost:3000/login",
				type:"POST",
				dataType:"json",
				data:$('#form_login').serialize(),
				success:function(data){
					console.log(data)
				},
				error:function(errmsg){
					console.log(errmsg)
				}
			})
		}
		</script>
	</body>
</html>
